import java.util.Scanner;

public class code3 {
        public static void main(String[] args) {
            Scanner scan = new Scanner(System.in);
            int T = scan.nextInt();
            while(T-->0) {
                double x1 =scan.nextDouble();
                double y1 =scan.nextDouble();
                double x2 =scan.nextDouble();
                double y2 =scan.nextDouble();
                double x3 =scan.nextDouble();
                double y3 =scan.nextDouble();
                double s = Math.abs(((y1-y3)*(x2-x3)-(y2-y3)*(x1-x3))/Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)));
                System.out.printf("%.2f",s);
            }

        }
}
